Skip to content

Draft: add support for nanoparticle models#148

Open
pm-blanco wants to merge 8 commits into
pyMBE-dev:mainfrom
pm-blanco:db_nanoparticles
Open

Draft: add support for nanoparticle models#148
pm-blanco wants to merge 8 commits into
pyMBE-dev:mainfrom
pm-blanco:db_nanoparticles

Conversation

@pm-blanco
Copy link
Copy Markdown
Collaborator

@pm-blanco pm-blanco commented Mar 9, 2026

Closes #144

Added

  • Added support for nanoparticle templates and instances in the canonical storage layer via NanoparticleTemplate and NanoparticleInstance.
  • Added new API methods pmb.define_nanoparticle and pmb.create_nanoparticle to define and build nanoparticles with configurable core particles and surface site composition.
  • Added nanoparticle site-construction utilities in pyMBE.lib.nanoparticle_tools for spherical site distribution, patch construction, and overlap checks.
  • Added sample script samples/nanoparticles_grxmc.py to demonstrate nanoparticle setup and simulation workflows.
  • Added dedicated nanoparticle unit tests (testsuite/nanoparticle_unit_tests.py) and coverage for nanoparticle-related code paths.

Changed

  • Rigid-body setup is now integrated into nanoparticle creation, allowing nanoparticles to be initialized as rigid objects directly from pmb.create_nanoparticle.
  • Nanoparticle construction now supports primary/secondary site partitioning and multi-patch layouts driven by template parameters.

Fixed

@pm-blanco pm-blanco added enhancement New feature or request bug Something isn't working labels Mar 9, 2026
@pm-blanco pm-blanco added this to the pyMBEv2.0.0 milestone Mar 9, 2026
@pm-blanco pm-blanco linked an issue Mar 9, 2026 that may be closed by this pull request
4 tasks
pm-blanco pushed a commit to pm-blanco/pyMBE that referenced this pull request Mar 20, 2026
pm-blanco pushed a commit to pm-blanco/pyMBE that referenced this pull request Mar 20, 2026
pmblanco and others added 2 commits March 23, 2026 11:47
Co-authored-by: Sebastian Pineda <sebastian.pineda_pineda@chem.lu.se>
Sebastian Pineda and others added 6 commits April 28, 2026 18:59
Co-authored-by: pm-blanco<pablomiguel.blanco@udl.cat>
Co-authored-by: pm-blanco<pablomiguel.blanco@udl.cat>
…lt concentration

Gradually grows the LJ offset of the nanoparticle core from zero to its
Lorentz-Berthelot target value, relaxing the system after each increment.
This prevents hard overlaps between the nanoparticle core and salt ions
that arise when the full offset is applied immediately at high salt
concentrations. Ion sigma and epsilon are now handled consistently through
a general variable instead of being hardcoded in each particle definition.
Also fixes a pre-existing bug where the Langevin thermostat was left OFF
before the production MD loop. Unit tests for the new function are added
to nanoparticle_unit_tests.py.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
thermostat.kT is not available in all ESPResSo versions; replace with
thermostat.langevin.is_active which is stable across versions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…; rename template file

Refactor the nanoparticle site definition from a float fraction to an
integer count per patch, making the physical meaning more explicit and
avoiding implicit conversions. The real fraction of primary sites is now
a computed output shown by print_nanoparticle_properties() rather than
an input parameter. Rename storage/templates/nanoparticle.py to
patchy_nanoparticle.py to better reflect the patchy nanoparticle model.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for nanoparticle models

2 participants